﻿@using System.Web.Optimization
@using VocaDb.Model.Service.Security
@using VocaDb.Web.Helpers
@model VocaDb.Web.Models.Ext.EmbedSongViewModel

@Styles.Render("~/Content/embedSong")

@{
	var current = Model.CurrentPV;
}

<div class="pvViewerContent" style="width: @(Model.PlayerWidth)px; height: @(Model.ContainerHeight)px">
	
    <input type="hidden" class="songId" value="@Model.Song.Id" />
	<h4 class="songPreviewTitle">
		<span id="songPreviewName" title="@Model.Song.AdditionalNames">
			<a target="_top" href="@Url.Action("Details", "Song", new { id = Model.Song.Id })">@Model.Song.Name</a>
		</span>
		&nbsp;
		<small id="songPreviewArtists">
			@Model.Song.ArtistString
			(@Translate.SongTypeNames[Model.Song.SongType])
		</small>
	</h4>
	<div style="height: @(Model.PlayerHeight)px" class="@("embed-pv" + (current != null ? " embed-pv-" + Model.CurrentServiceName : string.Empty))">		
		@if (current != null) {
			@PVHelpers.EmbedPV(current, Model.PlayerWidth, Model.PlayerHeight)
		}
	</div>
  
    <div class="pvLinks">
    @foreach (var pv in Model.MainPVs) {
	    <a href="@Url.Action("EmbedSong", new { songId = Model.Song.Id, pvId = pv.Id, w = Model.Width, h = Model.Height, lang = Request.Params[LoginManager.LangParamName] })">			
    	    <div class="item@(current != null && pv.Id == current.Id ? " active" : string.Empty)">
		        <img src="@Html.VideoServiceLinkUrl(pv.Service)" alt="@pv.Service" /> 
                @pv.Service
	        </div>
	    </a>
	}
    </div>
</div>

